import React, { Component } from 'react'
import { render } from 'react-dom'
import {
  Route,
  IndexRoute,
  Router,
  hashHistory,
  withRouter
} from 'react-router'
import { Home, ContactContainer } from './app/components/contact'

class App extends Component {
  render() {
    return (
      <div>{React.cloneElement(this.props.children, this.props)}</div>
    )
  }
}

const routes = (
  <Route path="/" component={App}>
    <IndexRoute component={Home} />
    <Route path="/contacts" component={ContactContainer} />
  </Route>
)

render(
  <Router history={hashHistory} routes={routes} />,
  document.getElementById('app')
)